package com.dc.designPattern._23_specification.impl.step2.spec;

import com.dc.designPattern._23_specification.impl.step2.User;

/**
 * Description: 用户规格实现_用户名称模糊匹配
 * @author: gdc
 * @date: 2021/8/20
 * @version 1.0
 */
public class UserByNameLike implements IUserSpecification{

    /**
     * 用户名称
     */
    private String name;

    public UserByNameLike(String name) {
        this.name = name;
    }

    @Override
    public boolean isSatisfiedBy(User user) {
        return user.getName().contains(name);
    }
}
